package com.thb.pay.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.thb.pay.api.sys.vo.req.SysLogPageReq;
import com.thb.pay.api.sys.vo.resp.SysLogVo;
import com.thb.pay.core.utils.PageResult;
import com.thb.pay.db.service.impl.BaseServiceImpl;
import com.thb.pay.db.utils.PageResultUtils;
import com.thb.pay.db.utils.PageUtils;
import com.thb.pay.db.utils.QueryUtils;
import com.thb.pay.system.entity.SysLog;
import com.thb.pay.system.mapper.SysLogMapper;
import com.thb.pay.system.service.SysLogService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 系统-操作日志表 服务实现类
 * </p>
 *
 * @author lucky
 * @since 2019-07-21
 */
@Service
public class SysLogServiceImpl extends BaseServiceImpl<SysLogMapper, SysLog> implements SysLogService {

    @Override
    public PageResult<SysLogVo> findPage(SysLogPageReq pageReq) {
        IPage<SysLog> currentPage = PageUtils.buildPage(pageReq);
        QueryWrapper wrapper = QueryUtils.buildQueryPage(pageReq);
        IPage<SysLog> pageResult = super.page(currentPage, wrapper);
        return PageResultUtils.build(pageResult, SysLogVo.class);
    }
}
